{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# BOSS documentation\n",
    "https://docs.theboss.io/docs/introduction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\u001b[1m\u001b[34mINFO: Recompiling stale cache file /usr/people/jingpeng/.julia/lib/v0.5/Images.ji for module Images.\n",
      "\u001b[0m\u001b[1m\u001b[34mINFO: Recompiling stale cache file /usr/people/jingpeng/.julia/lib/v0.5/Cairo.ji for module Cairo.\n",
      "\u001b[0m"
     ]
    }
   ],
   "source": [
    "using Images\n",
    "using ImageView\n",
    "using Colors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(ImageCanvas,ImageSlice2d: zoom = Graphics.BoundingBox(0.0,200.0,0.0,200.0))"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "using Colors\n",
    "using FixedPointNumbers\n",
    "ImageView.imshow((rand(RGB{Float32}, 200,200)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "search: \u001b[1mG\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22m \u001b[1mg\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22m \u001b[1mG\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22mA \u001b[1mG\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22m24 \u001b[1mg\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22mim A\u001b[1mG\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22m A\u001b[1mG\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22m\u001b[1my\u001b[22m32 \u001b[1mg\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22mdient \u001b[1mg\u001b[22m\u001b[1mr\u001b[22m\u001b[1ma\u001b[22mphemes B\u001b[1mG\u001b[22m\u001b[1mR\u001b[22m\u001b[1mA\u001b[22m\n",
      "\n"
     ]
    },
    {
     "data": {
      "text/markdown": [
       "`Gray` is a grayscale object. You can extract its value with `gray(c)`.\n"
      ],
      "text/plain": [
       "`Gray` is a grayscale object. You can extract its value with `gray(c)`.\n"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "LoadError",
     "evalue": "KeyError: key \"INTERN_PROTOCOL\" not found",
     "output_type": "error",
     "traceback": [
      "KeyError: key \"INTERN_PROTOCOL\" not found",
      "",
      " in access_env(::Base.##339#340, ::String) at ./env.jl:45",
      " in BOSSArrays.BOSSArray{T,N}(::DataType, ::Int64, ::String, ::String, ::String, ::Int64) at /usr/people/jingpeng/.julia/v0.5/BOSSArrays/src/BOSSArrays.jl:66 (repeats 2 times)"
     ]
    }
   ],
   "source": [
    "using BOSSArrays\n",
    "\n",
    "ba = BOSSArray()\n",
    "\n",
    "\n",
    "arr = ba[10001:10200, 10001:10200, 1]\n",
    "# @show arr\n",
    "\n",
    "\n",
    "# using Images\n",
    "# img = Image(arr)\n",
    "using ImageView\n",
    "using FixedPointNumbers\n",
    "ImageView.imshow( reinterpret(N0f8, arr) )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# compare with web access\n",
    "get image from web directly using this link\n",
    "https://api.theboss.io/v0.7/image/team2_waypoint/pinky10/em/xy/0/10000:10200/10000:10200/1/"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.5.1-pre",
   "language": "julia",
   "name": "julia-0.5"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
